/*
 * Copyright (C) 2010 Fred Barrie This program is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version. This program is distributed
 * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details. You should have received
 * a copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */
package org.aergia.vinny.gui.types;

import javax.swing.SortOrder;

/**
 * @author Fred
 */
public class ColumnDefinition {
	private final Class<?> columnClass;
	private final String columnName;
	private final int columnSortKey;
	private final SortOrder columnSortOrder;
	private final int columnWidth;

	public ColumnDefinition(final String columnName, final Class<?> columnClass) {
		this(columnName, columnClass, (columnClass == Boolean.class ? 50 : 0));
	}

	public ColumnDefinition(final String columnName, final Class<?> columnClass, final int columnWidth) {
		this(columnName, columnClass, columnWidth, 0, SortOrder.UNSORTED);
	}

	public ColumnDefinition(final String columnName, final Class<?> columnClass, final int columnWidth, final int columnSortKey, final SortOrder columnSortOrder) {
		this.columnName = columnName;
		this.columnClass = columnClass;
		this.columnWidth = columnWidth;
		this.columnSortKey = columnSortKey;
		this.columnSortOrder = columnSortOrder;
	}

	public Class<?> getColumnClass() {
		return this.columnClass;
	}

	public String getColumnName() {
		return this.columnName;
	}

	public int getColumnSortKey() {
		return this.columnSortKey;
	}

	public SortOrder getColumnSortOrder() {
		return this.columnSortOrder;
	}

	public int getColumnWidth() {
		return this.columnWidth;
	}
}
